# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-verboselogs
pkgname=('python2-verboselogs' 'python-verboselogs')
_pkgname=verboselogs
pkgver=1.7
pkgrel=7
pkgdesc="Verbose logging level for Python's logging module."
arch=('any')
url='https://pypi.org/project/verboselogs/#files'
license=('APACHE')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('13e96ac21e1cb5c68428b348bab63fc4d4ad34eaffe8e1554c05380f9115d2a3ccc6fa2e0a5ca8941e73bfb06537a3e46f29880e7ba3f47da0284279a9740211')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-verboselogs() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-verboselogs() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

